home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1993 July / InfoMagic USENET CD-ROM July 1993.ISO / sources / misc / volume23 / pbmplus / patch05oct91 < prev    next >
Encoding:
Text File  |  1991-10-17  |  12.0 KB  |  349 lines

  1. Newsgroups: comp.sources.misc
  2. From: jef@well.sf.ca.us (Jef Poskanzer)
  3. Subject:  v23i060:  pbmplus - Extended Portable Bitmap Toolkit, Patch05oct91
  4. Message-ID: <1991Oct18.024610.959@sparky.imd.sterling.com>
  5. X-Md4-Signature: cf9794f2f9a018977c4c038c868a59d7
  6. Date: Fri, 18 Oct 1991 02:46:10 GMT
  7. Approved: kent@sparky.imd.sterling.com
  8.  
  9. Submitted-by: jef@well.sf.ca.us (Jef Poskanzer)
  10. Posting-number: Volume 23, Issue 60
  11. Archive-name: pbmplus/patch05oct91
  12. Environment: UNIX
  13. Patch-To: pbmplus: Volume 23, Issue 36-59
  14.  
  15. This new version is dated 05oct91.  If you have the 27sep91 version,
  16. via comp.sources.misc or FTP, you can update with the appended patch
  17. file.  Or, you can FTP the new version complete from:
  18.  
  19.     export.lcs.mit.edu:contrib/pbmplus05oct91.tar.Z  (18.24.0.12)
  20.     ftp.ee.lbl.gov:pbmplus05oct91.tar.Z              (128.3.112.20)
  21.  
  22.       Jef Poskanzer  jef@well.sf.ca.us  {apple, ucbvax}!well!jef
  23.  
  24. - - - - - - - - - -
  25. diff -cr pbmplus27sep91/CHANGES pbmplus05oct91/CHANGES
  26. *** pbmplus27sep91/CHANGES    Fri Sep 27 01:43:48 1991
  27. --- pbmplus05oct91/CHANGES    Sat Oct  5 23:51:13 1991
  28. ***************
  29. *** 1,3 ****
  30. --- 1,14 ----
  31. + Changes since the 27sep91 comp.sources.misc distribution:
  32. +     Fixed spelling error in giftoppm.  Fixed ppmrelief to not shrink the
  33. +       image by 2 rows and columns.  Minor fix to pgmramp.  Fixed off-by-one
  34. +       error in pnmtoxwd.  Man page fix for pnmgamma.  (Arthur David Olson)
  35. +     Converted ANSI trigraphs in ppmtosixel into good old octal.  (Jeff Glover)
  36. +     Fix to 24/32 bit case in rasttopnm.  (Behr de Ruiter)
  37. +     Float/double portability fix to libppm4.  (Bruce Holmer, Ronald Khoo)
  38. +     Fixed typo in compat.ksh.  (Larry Virden)
  39. +     Fixed int/short incompatibility in tifftopnm.  (Salik Rafiq)
  40.   Changes during the extended beta test period, starting on 15jan91:
  41.   
  42.       Lots of fixes from: Anthony A. Datri, Arthur David Olson, David Brooks,
  43. diff -cr pbmplus27sep91/README pbmplus05oct91/README
  44. *** pbmplus27sep91/README    Fri Sep 27 13:49:21 1991
  45. --- pbmplus05oct91/README    Sat Oct  5 22:36:16 1991
  46. ***************
  47. *** 1,6 ****
  48.                     Extended Portable Bitmap Toolkit
  49. !                       Distribution of 27sep91
  50. !                    Previous distribution 05feb91
  51.   
  52.   
  53.   PBMPLUS is a toolkit for converting various image formats to and from
  54. --- 1,6 ----
  55.                     Extended Portable Bitmap Toolkit
  56. !                       Distribution of 05oct91
  57. !                    Previous distribution 27sep91
  58.   
  59.   
  60.   PBMPLUS is a toolkit for converting various image formats to and from
  61. diff -cr pbmplus27sep91/compat.ksh pbmplus05oct91/compat.ksh
  62. *** pbmplus27sep91/compat.ksh    Thu Sep 26 16:59:00 1991
  63. --- pbmplus05oct91/compat.ksh    Sat Oct  5 23:43:56 1991
  64. ***************
  65. *** 16,21 ****
  66. --- 16,22 ----
  67.   alias pbmtoxwd='pnmtoxwd'
  68.   alias pbmtrnspos='pnmflip -xy'
  69.   alias pcxtopbm='pcxtoppm'
  70. + alias pgmtops='pnmtops'
  71.   alias picttopbm='picttoppm'
  72.   alias ppmarith='pnmarith'
  73.   alias ppmconvol='pnmconvol'
  74. ***************
  75. *** 24,30 ****
  76.   alias ppmscale='pnmscale'
  77.   alias ppmshear='pnmshear'
  78.   alias ppmsmooth='pnmsmooth'
  79. - alias ppmtops='pnmtops'
  80.   alias ppmtops='pnmtops'
  81.   alias ppmtorast='pnmtorast'
  82.   alias ppmtoxwd='pnmtoxwd'
  83. --- 25,30 ----
  84. diff -cr pbmplus27sep91/version.h pbmplus05oct91/version.h
  85. *** pbmplus27sep91/version.h    Mon Sep 23 15:03:23 1991
  86. --- pbmplus05oct91/version.h    Sat Oct  5 22:35:33 1991
  87. ***************
  88. *** 1,4 ****
  89.   /* version.h - define the current version of PBM, PGM, PPM, and PNM
  90.   */
  91.   
  92. ! #define PBMPLUS_VERSION "27sep91"
  93. --- 1,4 ----
  94.   /* version.h - define the current version of PBM, PGM, PPM, and PNM
  95.   */
  96.   
  97. ! #define PBMPLUS_VERSION "05oct91"
  98. diff -cr pbmplus27sep91/pgm/pgmramp.c pbmplus05oct91/pgm/pgmramp.c
  99. *** pbmplus27sep91/pgm/pgmramp.c    Fri Jun 28 14:29:29 1991
  100. --- pbmplus05oct91/pgm/pgmramp.c    Sat Oct  5 23:08:10 1991
  101. ***************
  102. *** 62,72 ****
  103.           switch ( ramptype )
  104.           {
  105.           case RT_LR:
  106. !         *gP = col * PGM_MAXMAXVAL / cols;
  107.           break;
  108.   
  109.           case RT_TB:
  110. !         *gP = row * PGM_MAXMAXVAL / rows;
  111.           break;
  112.   
  113.           case RT_RECT:
  114. --- 62,72 ----
  115.           switch ( ramptype )
  116.           {
  117.           case RT_LR:
  118. !         *gP = col * PGM_MAXMAXVAL / ((cols == 1) ? 1 : (cols - 1));
  119.           break;
  120.   
  121.           case RT_TB:
  122. !         *gP = row * PGM_MAXMAXVAL / ((rows == 1) ? 1 : (rows - 1));
  123.           break;
  124.   
  125.           case RT_RECT:
  126. diff -cr pbmplus27sep91/pnm/pnmgamma.1 pbmplus05oct91/pnm/pnmgamma.1
  127. *** pbmplus27sep91/pnm/pnmgamma.1    Tue Jun  4 14:11:45 1991
  128. --- pbmplus05oct91/pnm/pnmgamma.1    Sat Oct  5 23:16:07 1991
  129. ***************
  130. *** 19,26 ****
  131.   The arguments specify what gamma value(s) to use.
  132.   A value of 1.0 leaves the image alone, less than one darkens it,
  133.   and greater than one lightens it.
  134. - .PP
  135. - All flags can be abbreviated to their shortest unique prefix.
  136.   .SH "SEE ALSO"
  137.   pnm(5)
  138.   .SH AUTHOR
  139. --- 19,24 ----
  140. diff -cr pbmplus27sep91/pnm/pnmtoxwd.c pbmplus05oct91/pnm/pnmtoxwd.c
  141. *** pbmplus27sep91/pnm/pnmtoxwd.c    Wed Sep 25 23:14:24 1991
  142. --- pbmplus05oct91/pnm/pnmtoxwd.c    Sat Oct  5 23:13:09 1991
  143. ***************
  144. *** 88,94 ****
  145.           case PPM_TYPE:
  146.           direct = 0;
  147.           pm_message( "computing colormap..." );
  148. !         chv = ppm_computecolorhist( xels, cols, rows, xmaxval, &colors );
  149.           if ( chv == (colorhist_vector) 0 )
  150.           {
  151.           pm_message(
  152. --- 88,94 ----
  153.           case PPM_TYPE:
  154.           direct = 0;
  155.           pm_message( "computing colormap..." );
  156. !         chv = ppm_computecolorhist( xels, cols, rows, xmaxval+1, &colors );
  157.           if ( chv == (colorhist_vector) 0 )
  158.           {
  159.           pm_message(
  160. diff -cr pbmplus27sep91/pnm/rasttopnm.c pbmplus05oct91/pnm/rasttopnm.c
  161. *** pbmplus27sep91/pnm/rasttopnm.c    Mon Sep 23 15:28:20 1991
  162. --- pbmplus05oct91/pnm/rasttopnm.c    Sat Oct  5 23:02:38 1991
  163. ***************
  164. *** 244,250 ****
  165.               PPM_ASSIGN(
  166.               *xP, pr_colormap.map[0][r], pr_colormap.map[1][g],
  167.               pr_colormap.map[2][b] );
  168. -         ++byteP;
  169.           }
  170.           break;
  171.   
  172. --- 244,249 ----
  173. diff -cr pbmplus27sep91/pnm/tifftopnm.c pbmplus05oct91/pnm/tifftopnm.c
  174. *** pbmplus27sep91/pnm/tifftopnm.c    Mon Sep 23 16:41:53 1991
  175. --- pbmplus05oct91/pnm/tifftopnm.c    Sat Oct  5 23:50:14 1991
  176. ***************
  177. *** 45,51 ****
  178.       int headerdump;
  179.       register u_char sample;
  180.       register int bitsleft;
  181. !     int bps, spp, photomet;
  182.       unsigned short** redcolormap;
  183.       unsigned short** greencolormap;
  184.       unsigned short** bluecolormap;
  185. --- 45,51 ----
  186.       int headerdump;
  187.       register u_char sample;
  188.       register int bitsleft;
  189. !     unsigned short bps, spp, photomet;
  190.       unsigned short** redcolormap;
  191.       unsigned short** greencolormap;
  192.       unsigned short** bluecolormap;
  193. diff -cr pbmplus27sep91/ppm/giftoppm.c pbmplus05oct91/ppm/giftoppm.c
  194. *** pbmplus27sep91/ppm/giftoppm.c    Wed Sep 25 22:25:38 1991
  195. --- pbmplus05oct91/ppm/giftoppm.c    Sat Oct  5 22:36:46 1991
  196. ***************
  197. *** 439,445 ****
  198.                   ;
  199.   
  200.               if (count != 0)
  201. !                 pm_message("missing EOD in data stream (common occurance)");
  202.               return -2;
  203.           }
  204.   
  205. --- 439,445 ----
  206.                   ;
  207.   
  208.               if (count != 0)
  209. !                 pm_message("missing EOD in data stream (common occurence)");
  210.               return -2;
  211.           }
  212.   
  213. diff -cr pbmplus27sep91/ppm/libppm4.c pbmplus05oct91/ppm/libppm4.c
  214. *** pbmplus27sep91/ppm/libppm4.c    Wed Sep 25 22:48:01 1991
  215. --- pbmplus05oct91/ppm/libppm4.c    Sat Oct  5 23:37:10 1991
  216. ***************
  217. *** 118,124 ****
  218.       /* It's a new-X11-style decimal/float rgb specifier. */
  219.       float fr, fg, fb;
  220.   
  221. !     if ( sscanf( colorname, "rgbi:%lf/%lf/%lf", &fr, &fg, &fb ) != 3 )
  222.           pm_error( inval, colorname );
  223.       if ( fr < 0.0 || fr > 1.0 || fg < 0.0 || fg > 1.0 || fb < 0.0 || fb > 1.0 )
  224.           pm_error( "invalid color specifier - \"%s\" - values must be between 0.0 and 1.0", colorname );
  225. --- 118,124 ----
  226.       /* It's a new-X11-style decimal/float rgb specifier. */
  227.       float fr, fg, fb;
  228.   
  229. !     if ( sscanf( colorname, "rgbi:%f/%f/%f", &fr, &fg, &fb ) != 3 )
  230.           pm_error( inval, colorname );
  231.       if ( fr < 0.0 || fr > 1.0 || fg < 0.0 || fg > 1.0 || fb < 0.0 || fb > 1.0 )
  232.           pm_error( "invalid color specifier - \"%s\" - values must be between 0.0 and 1.0", colorname );
  233. ***************
  234. *** 185,191 ****
  235.       /* It's an old-style decimal/float rgb specifier. */
  236.       float fr, fg, fb;
  237.   
  238. !     if ( sscanf( colorname, "%lf,%lf,%lf", &fr, &fg, &fb ) != 3 )
  239.           pm_error( inval, colorname );
  240.       if ( fr < 0.0 || fr > 1.0 || fg < 0.0 || fg > 1.0 || fb < 0.0 || fb > 1.0 )
  241.           pm_error( "invalid color specifier - \"%s\" - values must be between 0.0 and 1.0", colorname );
  242. --- 185,191 ----
  243.       /* It's an old-style decimal/float rgb specifier. */
  244.       float fr, fg, fb;
  245.   
  246. !     if ( sscanf( colorname, "%f,%f,%f", &fr, &fg, &fb ) != 3 )
  247.           pm_error( inval, colorname );
  248.       if ( fr < 0.0 || fr > 1.0 || fg < 0.0 || fg > 1.0 || fb < 0.0 || fb > 1.0 )
  249.           pm_error( "invalid color specifier - \"%s\" - values must be between 0.0 and 1.0", colorname );
  250. diff -cr pbmplus27sep91/ppm/ppmrelief.c pbmplus05oct91/ppm/ppmrelief.c
  251. *** pbmplus27sep91/ppm/ppmrelief.c    Fri Jun 28 14:30:48 1991
  252. --- pbmplus05oct91/ppm/ppmrelief.c    Sat Oct  5 22:38:29 1991
  253. ***************
  254. *** 50,61 ****
  255.       inputbuf = ppm_allocarray( cols, 3 );
  256.       outputrow = ppm_allocrow( cols );
  257.   
  258. !     ppm_writeppminit( stdout, cols - 2, rows - 2, maxval, 0 );
  259.   
  260.       /* Read in the first two rows. */
  261.       ppm_readppmrow( ifp, inputbuf[0], cols, maxval, format );
  262.       ppm_readppmrow( ifp, inputbuf[1], cols, maxval, format );
  263.   
  264.       /* Now the rest of the image - read in the 3rd row of inputbuf,
  265.       ** and convolve with the first row into the output buffer.
  266.       */
  267. --- 50,66 ----
  268.       inputbuf = ppm_allocarray( cols, 3 );
  269.       outputrow = ppm_allocrow( cols );
  270.   
  271. !     ppm_writeppminit( stdout, cols, rows, maxval, 0 );
  272.   
  273.       /* Read in the first two rows. */
  274.       ppm_readppmrow( ifp, inputbuf[0], cols, maxval, format );
  275.       ppm_readppmrow( ifp, inputbuf[1], cols, maxval, format );
  276.   
  277. +     /* Write out the first row, all zeros. */
  278. +     for ( col = 0; col < cols; ++col )
  279. +         PPM_ASSIGN( outputrow[col], 0, 0, 0 );
  280. +     ppm_writeppmrow( stdout, outputrow, cols, maxval, 0 );
  281.       /* Now the rest of the image - read in the 3rd row of inputbuf,
  282.       ** and convolve with the first row into the output buffer.
  283.       */
  284. ***************
  285. *** 73,82 ****
  286.           ( mv2 - PPM_GETG( inputbuf[rowb][col + 2] ) );
  287.           b = PPM_GETB( inputbuf[rowa][col] ) +
  288.           ( mv2 - PPM_GETB( inputbuf[rowb][col + 2] ) );
  289. !         PPM_ASSIGN( outputrow[col], r, g, b );
  290.           }
  291. !     ppm_writeppmrow( stdout, outputrow, cols - 2, maxval, 0 );
  292.       }
  293.       pm_close( ifp );
  294.   
  295.       exit( 0 );
  296. --- 78,93 ----
  297.           ( mv2 - PPM_GETG( inputbuf[rowb][col + 2] ) );
  298.           b = PPM_GETB( inputbuf[rowa][col] ) +
  299.           ( mv2 - PPM_GETB( inputbuf[rowb][col + 2] ) );
  300. !         PPM_ASSIGN( outputrow[col + 1], r, g, b );
  301.           }
  302. !     ppm_writeppmrow( stdout, outputrow, cols, maxval, 0 );
  303.       }
  304. +     /* And write the last row, zeros again. */
  305. +     for ( col = 0; col < cols; ++col )
  306. +         PPM_ASSIGN( outputrow[col], 0, 0, 0 );
  307. +     ppm_writeppmrow( stdout, outputrow, cols, maxval, 0 );
  308.       pm_close( ifp );
  309.   
  310.       exit( 0 );
  311. diff -cr pbmplus27sep91/ppm/ppmtosixel.c pbmplus05oct91/ppm/ppmtosixel.c
  312. *** pbmplus27sep91/ppm/ppmtosixel.c    Fri Sep 27 13:00:31 1991
  313. --- pbmplus05oct91/ppm/ppmtosixel.c    Sat Oct  5 22:59:27 1991
  314. ***************
  315. *** 16,25 ****
  316.   #define MAXVAL 100
  317.   #define MAXCOLORS 256
  318.   
  319. ! #define DCS '\x90'   /* Device Control String */
  320. ! #define ST  '\x9c'   /* String Terminator */
  321. ! #define CSI '\x9b'   /* Control String Introducer */
  322. ! #define ESC '\x1b'   /* Escape character */
  323.   
  324.   static pixel** pixels;   /* stored ppm pixmap input */
  325.   static colorhash_table cht;
  326. --- 16,25 ----
  327.   #define MAXVAL 100
  328.   #define MAXCOLORS 256
  329.   
  330. ! #define DCS '\220'   /* Device Control String */
  331. ! #define ST  '\234'   /* String Terminator */
  332. ! #define CSI '\233'   /* Control String Introducer */
  333. ! #define ESC '\033'   /* Escape character */
  334.   
  335.   static pixel** pixels;   /* stored ppm pixmap input */
  336.   static colorhash_table cht;
  337.  
  338. exit 0 # Just in case...
  339. -- 
  340. Kent Landfield                   INTERNET: kent@sparky.IMD.Sterling.COM
  341. Sterling Software, IMD           UUCP:     uunet!sparky!kent
  342. Phone:    (402) 291-8300         FAX:      (402) 291-4362
  343. Please send comp.sources.misc-related mail to kent@uunet.uu.net.
  344.